// OUTDOOR SCRIPT
//    Out 1,0: Valzakov Forest

beginoutdoorscript;

variables;

short choice;

body;

beginstate INIT_STATE;

break;


beginstate EXIT_STATE;

break;


beginstate START_STATE;

break;


beginstate 10;

if ((get_sdf(1,6) == 3) && (get_sdf(110,1) == 1)) {
 set_flag(1,6,4);
 message_dialog("_There!_ points Valzier. _Not too much farther. That is the teleportation platform that we seek._ He searches through the scrolls. He pulls out one sheet of papyrus.","_These instructions will tell us how to work it when we reach there. I will attempt to figure out what needs to be done._");
}

break;


beginstate 11;

 message_dialog("All eyes turn to Valzier. He looks over the platform, circling it several times. You notice the device to be quite crude compared to the toys the Empire has. The development of this crude structure alone, however, was an achievement.","_I just need to charge each node and focus the energy at the center and we are off! Now step on the platform._ You all do nervously. Valzier chants and the platform glows...");
 out_move_party(32,41);
 play_sound(10);
 force_instant_terrain_redraw();
 message_dialog("...suddenly there is a bright flash in concert with a loud boom. The forest twists around you in a span of time that could be from a split second to an hour. With a second loud clap, you all fall to the floor of the pedestal.","Your senses return as you awaken. The scenery is definitely different. It appears the teleportation pedestal has worked!");

break;


beginstate 12;

if ((get_sdf(1,6) == 4) && (get_sdf(110,1) == 1)) {
 set_flag(1,6,5);
 message_dialog("Klinger looks at Valzier's map. _From here we need to head due south. We'll run into a rocky outcropping. Head east around it and we will be there._","");
}

break;


beginstate 13;

 message_dialog("Just ahead you see the beach. If you continue any farther, you will leave this area of the forest and the scenario. If you want to leave, go onward. If not, stay back.","");

break;


beginstate 14;

if (get_sdf(2,24) == 0) {
 reset_dialog();
  add_dialog_str(0,"A hoard of giant reptillian creatures native to this island lie lazily out in the sun by this lake. They have long claws, sharp fangs, and probably carnivorous judging by the gnawed animal bones.",0);
  add_dialog_str(1,"You think you see a shiny glint near the lizard horde. One of you could attempt to sneak and steal it.",0);
  add_dialog_choice(0,"Try to steal the shiny object.");
  add_dialog_choice(1,"Back away.");
  choice = run_dialog(1);
 if (choice == 1) {
  if (run_select_a_pc(1) == 0) {
   outdoor_enc_result(1);
   message_dialog("You decide not to tempt fate today.","");
   end();
  }
  if (((get_stat(get_selected_pc(),1)) + (get_stat(get_selected_pc(),16))) >= 8) {
   reward_give(127);
   message_dialog("Using your high dexterity and intimate knowledge of the woods, you are able to sneak past the lizards and reach the shiny object.","You find the gnawed body of a Nephilim warrior. All that remains is a nice metal shield. You take it and quickly leave unnoticed.");
   set_flag(2,24,1);
   outdoor_enc_result(1);
   end();
  }
  else
   message_dialog("You try to sneak and steal the shiny metal object. You get close enough to see that it is indeed a shield. However, you are not apt enough to evade the sense of the reptiles. They hiss and lumber toward you.","");
 }
 if (choice == 2) {
  outdoor_enc_result(1);
  message_dialog("You decide not to tempt fate today.","");
 }
}
else {
 reset_dialog();
  add_dialog_str(0,"A hoard of giant reptillian creatures native to this island lie lazily out in the sun by this lake. They have long claws, sharp fangs, and probably carnivorous judging by the gnawed animal bones.",0);
  add_dialog_str(1,"You already stole the shield. However, you could kill off the menace if you so desired.",0);
  add_dialog_choice(0,"Kill the lizards.");
  add_dialog_choice(1,"Back away.");
  choice = run_dialog(1);
  if (choice == 1)
   message_dialog("You draw your weapons and charge the lizards. The creatures turn and brandish their claws.","");
  if (choice == 2) {
   outdoor_enc_result(1);
   message_dialog("Getting the shield was enough. You do not need to tempt fate and face the lizards as well.","");
 }
}
   
break;


beginstate 15;

reset_dialog();
add_dialog_str(0,"You kill off the reptillian creatures. The lizard's home was a sort of graveyard for the wildlife and Nephilim who dared venture too close. Little remains except for gnawed bones.",0);
if (get_sdf(2,24) == 0) {
 reward_give(127);
 add_dialog_str(1,"However, the shiny shield you saw is still intact. With the lizards gone, you easily claim your prize.",0);
}
add_dialog_choice(0,"OK.");
choice = run_dialog(1);

break;


beginstate 16;

if (get_sdf(2,25) == 0) {
 set_flag(2,25,1);
 message_dialog("Just ahead you see a fairly large isolated hut. Around it is a nice garden full of all sorts of flowers and herbs, a very welcoming sight on this remote island.","");
}

break;


beginstate 17;

reset_dialog();
add_dialog_str(0,"This wooded passage is filled to the brim with thick webs. Ahead, you see several gigantic spiders. They seem disinterested in you, at least so long as you keep your distance.",0);
add_dialog_choice(0,"Continue onward.");
add_dialog_choice(1,"Back away.");
choice = run_dialog(1);
 if (choice == 1)
  message_dialog("You continue down the passage, hoping the spiders will continue to ignore you. No such luck. They do not take too kindly to your intrusion upon their home.","");
 if (choice == 2) {
  outdoor_enc_result(1);
  message_dialog("You decide whatever may be in this passage is not worth the risk of facing the scary arachnids.","");
}

break;


beginstate 18;

message_dialog("You clean off the webs from yourself and your equipment. You look around and see no further signs of the hostile arachnids. The passage should be now free to explore.","");

break;


beginstate 19;

if (get_sdf(3,2) == 0) {
 reset_dialog();
  add_dialog_str(0,"At the end of this passage, you find the webbed corpse of a Nephilim, probably a shaman. He/she clutched on to a wooden rod with several runed carvings, probably a wand.",0);
  add_dialog_str(1,"It didn't help this poor soul, but it may be of use to you.",0);
  add_dialog_choice(0,"Take it.");
  add_dialog_choice(1,"Leave.");
  choice = run_dialog(1);
  if (choice == 1) {
   reward_give(284);
   set_flag(3,2,1);
   message_dialog("You take the wooden rod. It is quite crude, but still charged and effective.","");
  }
  if (choice == 2)
   end();
}

break;


beginstate 20;

if (get_sdf(3,3) == 0) {
 reset_dialog();
  add_dialog_str(0,"A lot of junk has washed up on this shore by the lake. Most of it is just random bits of garbage. However, a bottle containing a bluish liquid has remained intact.",0);
  add_dialog_choice(0,"Take the bottle.");
  add_dialog_choice(1,"Leave.");
  choice = run_dialog(1);
  if (choice == 1) {
   reward_give(223);
   set_flag(3,3,1);
   message_dialog("You take the bottle filled with a strange fluid. It has an odd glow and must be magical.","");
  }
  if (choice == 2)
   end();
}

break;